package utils

import java.io.File
import java.util.concurrent.ForkJoinPool

import implicits.{CSVTool, MyMapTool}
import org.apache.commons.io.FileUtils
import org.apache.commons.lang3.StringUtils

import scala.collection.mutable
import scala.collection.JavaConverters._
import scala.collection.parallel.{ForkJoinTaskSupport, ParSeq}
import scala.collection.parallel.mutable.ParArray
import scala.io.Source
import implicits.Implicits._

/**
 * Created by yz on 2019/4/25
 */
object Implicits{

  def splitByTab(str: String, sep: String = "\t") = str.split(sep).toList

  implicit class MyParArray[T](pars: ParSeq[T]) {

    def threadNum(t: Int) = {
      pars.tasksupport = new ForkJoinTaskSupport(new ForkJoinPool(t))
      pars

    }

  }


}
